package strategy;

/**
 * @Author: sijunqiang
 * @Date: 2020/5/11 11:56
 * @Description:
 */
// 定义具体的策略给类进行排序
public class Sorter implements Comparator {

    @Override
    public int compare(Object o1, Object o2) {
        String s1 = (String) o1;
        String s2 = (String) o2;
        return  Integer.compare(s1.length(),s2.length());

    }
}
